A spine-leaf network includes edge or leaf switches connected with servers over trunk ports. The servers are configured to host virtual machines that may be part of one or more virtual area networks (VLANs) configured on the leaf switches. The servers and virtual machines hosted thereon may participate in VLAN communication through virtual ports created on the leaf switches.
A virtual port associates a trunk port with a VLAN. Conventionally, a leaf switch creates virtual ports for all the configured VLANs on each trunk port by default even if the vlans are not used by the server. This is wasteful of leaf switch resources and results in needless VLAN traffic flooding to all trunk ports and virtual ports.